Encoding/decoding method and apparatus using bit allocation as a function of scale factor

ABSTRACT

At an encoder 1, an input signal delivered to an input terminal 100 is divided into 32 subband signals by an analysis filter bank 101 to determine scale factors indicating magnification which normalizes respective subband signals by a scaling section 102 to determine the numbers of allocation bits of the respective subband signals by a bit allocation section 103 in dependency upon their scale factors to quantize the respective subband signals by the determined numbers of allocation bits by a quantizing section 104 to encode the respective quantized subband signals and the scale factors with respect to the respective subband signals. On the other hand, at a decoder 2, an inverse quantizing section 108 is used to determine the numbers of allocation bits by using scale factors included in the encoded signal with respect to the respective subband signals of the encoded signal to inverse-quantize the subband signals to judge whether or not scale factors are preserved with respect to the respective inverse-quantized subband signals to carry out, for a second time, inverse quantization with respect to the subband signals where no scale factor is preserved so as to preserve scale factors.

TECHNICAL FIELD

This invention relates to an encoding method, a decoding method, anencoding/decoding method, an encoding apparatus, a decoding apparatus,and an encoding/decoding apparatus suitable when used for dividing anoriginal signal such as audio data, etc. into signals (signalcomponents) in a plurality of frequency bands to carry outencoding/decoding thereof, and more particularly relates to an encodingmethod, a decoding method, an encoding/decoding method, an encodingapparatus, a decoding apparatus, and an encoding/decoding apparatus suchthat, in quantizing subband signals obtained after undergone frequencyband division, or spectrum signals obtained by orthogonal transformprocessing, etc., the numbers of bits are dynamically allocated torespective subbands or respective spectrum groups.

BACKGROUND ART

For example, as the technique for encoding audio data, there is socalled Sub-Band Coding (SBC) for dividing audio data into data portionsin a plurality of frequency bands to encode them.

In accordance with the Sub-Band Coding system, in the case where thenumbers of bits for quantizing sub-band signals obtained after undergonefrequency band division by the Band Pass Filter (BPF) are allocated,there is conducted a processing to calculate energies of respectivesub-bands by using the sub-band signals to allocate the numbers of bitsthereto in dependency upon their energies.

Alternatively, apart from the sub-band signals, there is carried out aprocessing to determine spectrum components (spectrum signals) by theFast Fourier Transform (FFT), etc. to allocate the numbers of bits bymaking use of the auditory sense characteristic from those spectrumcomponents (spectrum signals).

Moreover, in the so-called Transform Coding for bundling spectrumcomponents (spectrum signals) obtained after undergone the orthogonaltransform processing, etc. by several components so that they aredivided into groups to carry out quantization every respective spectrumgroups, in the case where the numbers of bits are allocated torespective spectrum groups, a processing for allocating the numbers ofbits in dependency upon energies of respective spectrum groups, and aprocessing for allocating the numbers of bits by making use of theauditory sense characteristic from the spectrum are carried out.

In a manner as described above, the numbers of bits are allocated torespective sub-bands or respective spectrum groups, and sub-band signalsor spectrum signals are normalized by scale factors in dependency uponthe allocated numbers of bits. Quantization processing is implemented tothe signals thus normalized. Then, the sub-band signals or the spectrumsignals which have undergone quantization processing are composed into abit stream for transmission or recording onto the recording medium inaccordance with a predetermined format. The bit stream thus composed isoutputted.

In this case, in decoding data which has undergone encoding processingin a manner as described above, bit allocation information which is thenumbers of bits allocated to the sub-bands or the spectrum groups cannotbe determined by inverse operation from the encoded data. For thisreason, a format adapted for recording, at the same time, bit allocationinformation along with scale factors is used.

Further, e.g., in the memory for composition into the bit stream, incomposition into the bit stream in accordance with the format determinedas described above, there is limitation in capacity for storing the bitallocation information into the memory. For this reason, after upperlimit is set with respect to the number of allocation bits, bitallocation to the sub-bands or the spectrum groups is carried out.

For example, in the Precision Adaptive Subband Coding (PASC) systememployed in the so-called Digital Compact Cassette (DCC), in allocatingthe numbers of bits to respective bands obtained after undergonefrequency band division, Fourier Transform is used to calculate spectrumcomponents. Then, those spectrum components are used to calculatemasking pattern to calculate the numbers of allocation bits. In thisPASC system, the format adapted for recording bit allocation informationand scale factors is employed, and the upper limit of the number ofallocation bits is set to 15 bits.

Moreover, in the so-called Mini Disc (MD), the system of compressingaudio data so that data quantity is reduced to one fifth (hereinafterreferred to as 1/5 compression) is employed. In this system, there is nostandardization in regard to bit allocation. In the 1/5 compressionsystem, there is employed the format adapted for recording bitallocation information and scale factors of coding unit in whichspectrum components (spectrum signals) are bundled every severalcomponents, and the upper limit of the number of allocation bits is setto 16 bits.

Further, T.A. Ramstad has proposed, in "CONSIDERATIONS ON QUANTIZATIONAND DYNAMIC BIT-ALLOCATION IN SUBBAND CODERS", ICASSP '86 pp. 841-844, amethod of calculating energies every respective subbands to allocatebits while repeatedly dividing those energies by constant.

In addition, in regard to quantization of the dynamic range ofrespective sub-bands or respective spectrum groups, there are manyinstances where the signal amplitude is small as the property of signal.On the other hand, in the case where the signal amplitude is large asthe property of the auditory sense, even when quantizing noise is great,quantizing noise is difficult to be heard by masking. For this reason,quantization using logarithmic function is carried out.

As the Sub-Band Coding system, various systems have been conventionallyproposed. As the representative system, there is, e.g., 32 band/subbandcoding in the Audio data coding algorithm ISO/IEC IS 11172-3 (MPEG1audio) of the International Standard, i.e., layer I of the so-calledMPEG audio.

The coding algorithm of the layer 1 of the MPEG audio will now bedescribed.

Initially, an input signal linearly quantized so that one sample isequal to 16 bits is divided into sub-band signals of 32 sub-bands by thesubband analysis filter in the state where 384 samples are caused to beone frame and respective sub-bands are caused to be 12 samples.

Then, scale factors indicating magnification for normalizing dynamicranges of respective sub-band signals into 1 are determined every 12samples as described below.

Namely, the maximum value of the absolute value of 12 samples, i.e.,dynamic range is determined to use, as scale factor, minimum valueslarger than that dynamic range.

    ______________________________________                                        index      SF(scale factor)                                                   ______________________________________                                        Table 1A                                                                       0         2.00000000000000                                                    1         1.58740105196820                                                    2         1.25992104989487                                                    3         1.00000000000000                                                    4         0.79370052598410                                                    5         0.62996052494744                                                    6         0.50000000000000                                                    7         0.39685026299205                                                    8         0.31498026247372                                                    9         0.25000000000000                                                   10         0.19842513149602                                                   11         0.15749013123686                                                   12         0.12500000000000                                                   13         0.09921256574801                                                   14         0.07874506561843                                                   15         0.06250000000000                                                   16         0.04960628287401                                                   17         0.03937253280921                                                   18         0.03125000000000                                                   19         0.02480314143700                                                   20         0.01968626640461                                                   Table 1B                                                                      21         0.01562500000000                                                   22         0.01240157071850                                                   23         0.00984313320230                                                   24         0.00781250000000                                                   25         0.00620078535925                                                   26         0.00492156660115                                                   27         0.00390625000000                                                   28         0.00310039267963                                                   29         0.00246078330058                                                   30         0.00195312500000                                                   31         0.00155019633981                                                   32         0.00123039165029                                                   33         0.00097656250000                                                   34         0.00077509816991                                                   35         0.00061519582514                                                   36         0.00048828125000                                                   37         0.00038754908495                                                   38         0.00030759791257                                                   39         0.00024414062500                                                   40         0.00019377454248                                                   Table 1C                                                                      41         0.00015379895629                                                   42         0.00012207031250                                                   43         0.00009688727124                                                   44         0.00007689947814                                                   45         0.00006103515625                                                   46         0.00004844363562                                                   47         0.00003844973907                                                   48         0.00003051757813                                                   49         0.00002422181781                                                   50         0.00001922486954                                                   51         0.00001525878906                                                   52         0.00001211090890                                                   53         0.00000961243477                                                   54         0.00000762939453                                                   55         0.00000605545445                                                   56         0.00000480621738                                                   57         0.00000381469727                                                   58         0.00000302772723                                                   59         0.00000240310869                                                   60         0.00000190734863                                                   61         0.00000151386361                                                   62         0.00000120155435                                                   ______________________________________                                    

On the other hand, result obtained by allowing the input signal toundergo Fast Fourier Transform (FFT) is used to calculate masking, thusto determine the numbers of allocation bits with respect to respectivesub-bands. Then, respective sub-band signals are quantized in accordancewith the obtained numbers of allocation bits. Namely, quantized value Ycan be determined by the operation expressed as the formula (1) by usingscale factor SF, the number of allocation bits N, and sub-band signal X:

    Y=rint{(X/SF)×((2.sup.N -1)/2)}                      (1)

In the above formula, "rint {z}" indicates function representing integernearest to "Z".

The decoding algorithm of the layer I of the MPEG audio will now bedescribed.

When the sub-band signal X is derived from the above-mentioned formula(1), this sub-band signal X is expressed as follows:

    X=Y×SF×(2/(2.sup.N -1))                        (2)

The respective encoded sub-band signals are inverse-quantized inaccordance with the above-mentioned formula (2). Namely, an approach isemployed to inverse-quantize quantized values Y so that they are equalto values which are just middle of respective partitions to multiplythem by scale factors SF to carry out inverse scaling. Then, therespective inverse-quantized sub-band signals are synthesized into anaudio signal by sub-band synthesis filter.

Further, the audio data encoding/decoding method or the audio dataencoding/decoding apparatus for carrying out encoding processing anddecoding processing as described above is used, e.g., in copying audiodata.

However, in the case where audio data is copied, i.e., encoding iscarried out with respect to a decoded signal for a second time in theabove-mentioned audio data encoding/decoding method, when bit allocationis carried out by using the result of the Fast Fourier Transform asdescribed above, the number of allocated (allocation) bits at the timeof the last encoding and the number of allocated (allocation) bits ofthis time are not necessarily in correspondence with each other.Further, since any quantization error takes place in quantization, ifthe number of allocated bits of the last time and the number ofallocated bits of this time are different from each other, any furtherquantization error would take place also at this stage. For this reason,sound quality would be deteriorated every time encoding/decoding isrepeated.

Moreover, in the case where the numbers of bits for quantization ofsub-bands in the sub-band coding or spectrum groups in the transformcoding are dynamically allocated, e.g., energies of respective sub-bandsor respective spectrum groups calculated by using respective sub-bandsignals or spectrum signals were used, or information calculatedindependently of the sub-band signals or the spectrum signals were usedto allocate the numbers of bits. For this reason, the circuit for bitallocation became very large.

Further, when data encoded by an encoding system as described above isdecoded by a decoding apparatus, etc., the numbers of bits allocated torespective sub-bands or respective spectrum groups were required alongwith scale factors of the respective sub-bands or the respectivespectrum groups. Accordingly, there took place the necessity ofoutputting allocation bit information along with the scale factors. Forthis reason, the number of allocation bits per one sub-band signal orone spectrum signal was reduced, thus failing to improve quantizationefficiency.

In addition, since there was the upper limit in the number of allocationbits, in the case where a signal of a specific frequency is encoded,sufficient number of bits could not be allocated to the sub-band or thespectrum group where that frequency is included.

This invention has been made in view of actual circumstances of theprior arts as described above, and has the following objects.

An object of this invention is to provide an encoding method, a decodingmethod, an encoding/decoding method, an encoding apparatus, a decodingapparatus, and an encoding/decoding apparatus which can improve thesound quality.

Another object of this invention is to provide an encoding method, adecoding method, an encoding/decoding method, an encoding apparatus, adecoding apparatus, and an encoding/decoding apparatus which cansimplify the circuit for bit allocation.

A further object of this invention is to provide an encoding method, adecoding method, an encoding/decoding method, an encoding apparatus, adecoding apparatus, and an encoding/decoding apparatus which can improvequantization efficiency.

A still further object of this invention is to provide an encodingmethod, a decoding method, an encoding/decoding method, an encodingapparatus, a decoding apparatus, and an encoding/decoding apparatuswhich can allocate sufficient numbers of bits to respective bands ofsignals (signal components) divided into a plurality of frequency bands.

DISCLOSURE OF THE INVENTION

In an encoding method according to this invention, an approach isemployed to divide an original signal into signals (signal components)in a plurality of frequency bands to determine, with respect to thesignals of the respective divided frequency bands, numbers of allocationbits as bit allocation condition where only their scale factors arecaused to be dependent upon the original signal to carry out bitallocation to quantize the signals of the respective frequency bands bythe numbers of allocation bits which have undergone bit allocation toencode only the quantized signals of the respective frequency bands andscale factors with respect to the signals of the respective frequencybands.

In the encoding method according to this invention, the numbers ofallocation bits are determined, with respect to, e.g., sub-band signalsobtained by dividing an original signal into signals (signal components)in sub-bands of a plurality of frequency bands, or spectrum signalsobtained by dividing an original signal into spectrum groups of aplurality of frequency bands, as the bit allocation condition where onlytheir scale factors are caused to be dependent upon the original signal.

Moreover, in the encoding method according to this invention, theabove-mentioned scale factors SF are calculated by the operationexpressed below by using quantized value SFid (integer) of the dynamicrange, constant r, constant k, and integer constant s with respect tosignals of the respective frequency bands:

    SF=r.sup.SFid/s+k

to determine the numbers of allocation bits in accordance with thecalculated scale factors SF to carry out bit allocation.

Further, in the encoding method according to this invention, the numberof allocation bits is determined without setting an upper limit of thenumber of allocation bits.

Moreover, a decoding method according to this invention is directed to adecoding method for decoding an encoded signal encoded by dividing anoriginal signal into signals (signal components) in a plurality offrequency bands, determining, with respect to the signals of therespective divided frequency bands, numbers of allocation bits as thebit allocation condition where only their scale factors are caused to bedependent upon the original signal, quantizing signals of the respectivefrequency bands by the numbers of allocation bits which have undergonebit allocation, and encoding only the quantized signals of therespective bands and the scale factors with respect to the respectivefrequency bands, wherein the decoding method comprises the steps of:determining the numbers of allocation bits by using the scale factorsincluded in the encoded signal with respect to the signals of therespective frequency bands of the encoded signal, inverse-quantizing thesignals of the respective frequency bands of the encoded signal by usingthe determined numbers of allocation bits, determining whether or notthe scale factors are preserved with respect to the inverse-quantizedsignals of the respective frequency bands, and carrying out, for asecond time, inverse-quantization with respect to the signal of each ofthe frequency band where no scale factor is preserved so that the scalefactor is preserved so as to decode the encoded signal in the statewhere the scale factors of the signals of the respective frequency bandsare preserved.

In the decoding method according to this invention, e.g., sub-bandsignals obtained by dividing an original signal into signals insub-bands of a plurality of frequency bands, or spectrum signalsobtained by dividing an original signal into signals in spectrum groupsof a plurality of frequency bands are decoded in the state whererespective scale factors are preserved.

An encoding/decoding method according to this invention comprises: (anencoding step including) dividing an original signal into signals in aplurality of frequency bands, determining, with respect to the signalsof the respective divided frequency bands, numbers of allocation bits asbit allocation condition where only their scale factors are caused to bedependent upon the original signal to carry out bit allocation,quantizing the signals of the respective frequency bands by the numbersof allocation bits which have undergone bit allocation, and encodingonly the quantized signals of the respective frequency bands and thescale factors with respect to the respective frequency bands; (adecoding step including) determining the numbers of allocation bits byusing the scale factors included in the encoded signal with respect tothe signals of the respective frequency bands of the encoded signal,inverse-quantizing the signals of the respective frequency bands of theencoded signal by using the determined number of allocation bits,determining whether or not the scale factors are preserved with respectto the inverse-quantized signals of the respective frequency bands, andcarrying out, for a second time, inverse-quantization with respect tothe signal of each of the frequency bands where no scale factor ispreserved so that the scale factor is preserved so as to decode theencoded signal in the state where the scale factors of the signals ofthe respective frequency bands are preserved.

In the encoding/decoding method according to this invention, e.g.,sub-band signals obtained by dividing an original signal into signals insub-bands of a plurality of frequency bands, or spectrum signalsobtained by dividing an original signal into signals in spectrum groupsof a plurality of frequency bands are encoded to decode the encodedsignal in the state where the scale factors of the signals of therespective frequency bands are preserved.

Moreover, in the encoding/decoding method according to this invention,the scale factors SF are calculated by the operation expressed below byusing quantized value SFid (integer) of the dynamic range, constant r,constant k and integer constant s with respect to the signals of therespective frequency bands

    SF=r.sup.SFid/s+k

to determine the numbers of allocation bits in accordance with thecalculated scale factors, thus to carry out bit allocation.

Further, in the encoding/decoding method according to this invention,the number of allocation bits is determined without setting an upperlimit of the number of allocation bits.

Moreover, an encoding apparatus according to this invention comprises:band dividing means for dividing an original signal into signals in aplurality of frequency bands, scaling means for calculating scalefactors with respect to the signals of the respective frequency bandsdivided by the band dividing means, bit allocation means fordetermining, with respect to the signals of the respective frequencybands divided by the band dividing means, numbers of allocation bits, asbit allocation condition where only scale factors calculated by thescaling means are caused to be dependent upon the original signal tocarry out bit allocation, quantizing means for quantizing the signals ofthe respective frequency bands and the scale factors by the numbers ofallocation bits which have undergone bit allocation by the bitallocation means, and formatting means for outputting, in apredetermined format, an encoded signal generated by encoding only thesignals of the respective frequency bands and the scale factors withrespect to the signals of the respective frequency bands which have beenquantized by the quantizing means.

In the encoding apparatus according to this invention, theabove-mentioned band dividing means is used to divide an original signalinto e.g., subband signals of a plurality of frequency bands, orspectrum signals of spectrum groups.

Moreover, in the encoding apparatus according to this invention, thescaling means is used to calculate the scale factors SF by the operationexpressed below by using quantized value SFid (integer) of the dynamicrange, constant r, constant k and integer constant s with respect to thesignals of the respective frequency bands:

    SF=r.sup.SFid/s+k

Further, in the encoding apparatus according to this invention, the bitallocation means is used to determine the number of allocation bitswithout setting the upper limit of the number of allocation bits.

Moreover, a decoding apparatus according to this invention is directedto a decoding apparatus for decoding an encoded signal generated bydividing an original signal into signals (signal components) in aplurality of frequency bands, determining, with respect to the signalsof the respective divided frequency bands, numbers of allocation bits asthe bit allocation condition where only their scale factors are causedto be dependent upon the original signal, quantizing signals of therespective frequency bands by the numbers of allocation bits which haveundergone bit allocation, and encoding only the quantized signals of therespective frequency bands and the scale factors with respect to thesignals of the respective frequency bands, the decoding apparatuscomprises inverse quantizing means for determining the numbers ofallocation bits by using the scale factors included in the encodedsignal with respect to the signals of the respective frequency bands ofthe encoded signal, inverse-quantizing the signals of the respectivefrequency bands of the encoded signal by using the determined numbers ofallocation bits, determining whether or not the scale factors arepreserved with respect to the inverse-quantized signals of therespective frequency bands and carrying out, for a second time,inverse-quantization with respect to the signal of each of the frequencybands where no scale factor is preserved so as to preserve the scalefactor.

An encoding/decoding apparatus according to this invention comprises:encoding means for dividing an original signal into signals (signalcomponents) in a plurality of frequency bands, determining, with respectto the signals of the respective divided frequency bands, numbers ofallocation bits as bit allocation condition where only their scalefactors are caused to be dependent upon the original signal to carry outbit allocation, quantizing the signals of the respective frequency bandsby the numbers of allocation bits which have undergone bit allocationand encoding only the quantized signals of the frequency bands and thescale factors with respect to the quantized signals of the respectivefrequency band; and decoding means for determining the numbers ofallocation bits by using the scale factors included in the encodedsignal, with respect to the signals of the respective frequency bands ofthe encoded signal, inverse-quantizing the signals of the respectivefrequency bands of the encoded signal by using the determined numbers ofallocation bits, determining whether or not the scale factors arepreserved with respect to the inverse-quantized signals of therespective frequency bands, and carrying out, for a second time, inversequantization with respect to the signal of each of the frequency bandswhere no scale factors is preserved so as to decode the encoded signalsof the respective frequency bands in the state where the scale factorsare preserved.

In the encoding/decoding apparatus according to this invention, whereinthe encoding means includes, e.g., band dividing means for dividing theoriginal signal into the signals (signal components) in the plurality offrequency bands, scaling means for calculating the scale factors withrespect to the signals of the respective frequency bands divided by theband dividing means, bit allocation means for determining the numbers ofallocation bits as the bit allocation condition where only the scalefactors calculated by the scaling means are caused to be dependent uponthe original signal to carry out bit allocation with respect to thesignals of the respective frequency bands divided by the band dividingmeans, quantizing means for quantizing the signals of the respectivefrequency bands and the scale factors by the numbers of allocation bitswhich have undergone bit allocation by the bit allocation means, andformatting means for outputting, in a predetermined format, an encodedsignal generated by encoding only the signals of the respectivefrequency bands and the scale factors with respect to the signals of therespective frequency bands which have been quantized by the quantizingmeans.

In the encoding/decoding apparatus according to this invention, the banddividing means is used to divide an original signal into, e.g., sub-bandsignals of a plurality of frequency bands or spectrum signals ofspectrum groups.

Further, in the encoding/decoding apparatus according to this invention,the scaling means is used to calculate the scale factors SF by theoperation expressed below by using quantized value SFid (integer) of thedynamic range, constant r, constant k and integer constant s withrespect to the signals of the respective frequency bands:

    SF=r.sup.SFid/s+k

In addition, in the encoding/decoding apparatus according to thisinvention, the bit allocation means is used to determine the number ofallocation bits without setting an upper limit of the numbers ofallocation bits.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing the configuration of anencoding/decoding apparatus for an audio signal to which this inventionis applied.

FIG. 2 is a view for explaining band division processing in analysisfilter bank of the encoding/decoding apparatus.

FIG. 3 is a flowchart showing calculation processing of scale factors inscaling section of the encoding/decoding apparatus.

FIG. 4 is a view showing an example of sample values of sub-band signalssubjected to band division by the analysis filter bank and scale factor.

FIG. 5 is a flowchart showing bit allocation processing in bitallocation section of the encoding/decoding apparatus.

FIG. 6 is a flowchart showing another example of bit allocationprocessing in the bit allocation section.

FIG. 7 is a flowchart showing inverse-quantization processing ininverse-quantizing section of the encoding/decoding apparatus.

BEST MOST FOR CARRYING OUT THE INVENTION

A preferred embodiment of this invention will now be described in detailwith reference to the attached drawings.

An encoding method, a decoding method and an encoding/decoding methodaccording to this invention are carried out by an encoding/decodingapparatus for audio signal of a structure as shown in FIG. 1, forexample.

The encoding/decoding apparatus for audio signal is constituted with anencoder 1 for encoding an audio signal inputted through an inputterminal 100 as an original signal, storage media 106 onto whichrespective band signals encoded by the encoder 1 are recorded, and adecoder 2 for decoding the respective encoded band signals recorded onthe storage media 106 to output generated audio signals through anoutput terminal 110.

Initially, the configuration and the operation of the encoder 1 will bedescribed below.

The encoder 1 is composed of an analysis filter bank 101 for dividing anoriginal signal inputted through the input terminal 100 into subbandsignals of 32 bands, a scaling section 102 for calculating scale factorswith respect to the respective subband signals divided by the analysisfilter bank 101, a bit allocation section 103 for determining thenumbers of allocation bits with respect to respective subband signals inaccordance with the scale factors calculated by the scaling section 102to carry out bit allocation, a quantizing section 104 for quantizing thesubband signals by the numbers of allocation bits allocated by the bitallocation section 103, and a formatting section for formatting therespective subband signals, bit allocation information and scale factorswhich have been quantized by the quantizing section 104 to record themonto the storage media 106.

The input terminal 100 is supplied, as an original signal, e.g., anaudio signal having frequency band of 0˜24 kHz. The audio signal isassumed such that one sample is linearly quantized into 16 bits, e.g.,by sampling frequency fs of 48 kHz.

The analysis filter bank 101 serves to divide the input signal into 32subband signals. For example, as shown in FIG. 2, in the operation modeof the sampling frequency fs=48 kHz, an original signal having frequencyband of 0˜24 kHz is divided into 32 subband signals each havingbandwidth of 750 Hz. In more practical sense, with respect to an audiosignal linearly quantized so that one sample is equal to 16 bits, in thestate where 384 samples is caused to be one frame and respectivesubbands are caused to be 12 samples, the audio signal is divided into32 subbands subband 0˜subband 31.

The scaling section 102 determines, in a manner described below, every12 samples, scale factors indicating magnification which normalizesdynamic ranges of respective subband signals into 1 with respect torespective subband signals divided into 32 subbands.

The processing for calculating scale factors with respect to respectivesubband signals in the scaling section 102 will be described below withreference to the flowchart shown in FIG. 3.

Calculations of scale factors are carried out every respective subbands(12 samples), i.e., 384 times as a whole.

Initially, at step SP201, the maximum value of the absolute value of 12samples, i.e., dynamic range dr is determined. The dynamic range dr isexpressed as follows:

    dr=Max{|xi||0≦i≦11|}

At the subsequent step SP202, the dynamic range dr is quantized. Tospeak in more practical sense, in the case where dr=0, i.e., the dynamicrange dr is zero, quantized value SFid of the dynamic range dr isexpressed as follows:

    SFid=0

Moreover, in the case where dr≧0, i.e., the dynamic range dr is greaterthan zero, the quantized value SFid is expressed as follows:

    SFid=Max{0, 16+3log.sub.2 dr!}

In the above expression, " x!" indicates function to give back maximuminteger less than "x".

At step SP203, scale factor SF is calculated by the operation expressedbelow by using constant r (=2), constant K (=-5) and integer constant s(=3) from the quantized value SFid:

    SF=r.sup.SFid/s+k =2.sup.SFid/3-5

In a manner as described above, the scaling section 102 calculates scalefactors SF of respective subbands.

At the scaling section 102, in place of calculating scale factors SF ofrespective subband signals in this way, an approach may be employed todetermine maximum absolute values every 12 samples of the respectivesubband signals to use, as scale factor, values equal to the maximumabsolute value, or minimum one of values greater than the maximumabsolute value of the scale factors shown in Table 2.

    ______________________________________                                        index     SF(scale factor)                                                    ______________________________________                                        Table 2A                                                                       0        0.031250000000000000                                                 1        0.039372532809214780                                                 2        0.049606282874006244                                                 3        0.062500000000000000                                                 4        0.078745065618429588                                                 5        0.099212565748012460                                                 6        0.125000000000000000                                                 7        0.157490131236859180                                                 8        0.198425131496024920                                                 9        0.250000000000000000                                                10        0.314980262473718240                                                11        0.396850262992049840                                                12        0.500000000000000000                                                13        0.629960524947436480                                                14        0.793700525984099680                                                15        1.000000000000000000                                                16        1.259921049894873200                                                17        1.587401051968199400                                                18        2.000000000000000000                                                19        2.519842099789745900                                                20        3.174802103936398700                                                Table 2B                                                                      21        4.000000000000000000                                                22        5.039682199579493700                                                23        6.349604207872797400                                                24        8.000000000000000000                                                25        10.079368399158987000                                               26        12.699208415745595000                                               27        16.000000000000000000                                               28        20.158736798317967000                                               29        25.398416831491197000                                               30        32.000000000000000000                                               31        40.317473596635935000                                               32        50.796833662982394000                                               33        64.000000000000000000                                               34        80.634947193271870000                                               35        101.593667325964790000                                              36        128.000000000000000000                                              37        161.269894386543740000                                              38        203.187334651929580000                                              39        256.000000000000000000                                              40        322.539788773087650000                                              Table 2C                                                                      41        406.374669303858920000                                              42        512.000000000000000000                                              43        645.079577546175300000                                              44        812.749338607717850000                                              45        1024.000000000000000000                                             46        1290.159155092350600000                                             47        1625.498677215435700000                                             48        2048.000000000000000000                                             49        2580.318310184701200000                                             50        3250.997365430871400000                                             51        4096.000000000000000000                                             52        5160.636620369402400000                                             53        6501.994708861742800000                                             54        8192.000000000000000000                                             55        10321.273240738805000000                                            56        13003.989417723486000000                                            57        16384.000000000000000000                                            58        20642.546481477610000000                                            59        26007.978835446971000000                                            60        32768.000000000000000000                                            61        41285.092962955219000000                                            62        52015.957670893942000000                                            63        65536.000000000000000000                                            ______________________________________                                    

For example, assuming that 12 samples in the frame of time t₀ ˜t₁ ofsubband signals of subband 0 with respect to the input signal shown inthe FIG. 2 mentioned above have respective values as shown in FIG. 4,since the maximum absolute value is "5214" and satisfies the followinginequality relationship

    5161≦5214<6502,

scale factor SF of the subband 0 in this frame becomes "6502". Also withrespect to the remaining respective subbands subband 1˜subband 31, scalefactors SF can be similarly determined.

Moreover, the bit allocation section 103 determines the numbers ofallocation bits with respect to respective subband signals in accordancewith the scale factors SF of respective subband signals calculated bythe scaling section 102.

The bit allocation processing in the bit allocation section 103 will nowbe described with reference to the flowchart shown in FIG. 5.

Initially, at step SP301, the number of bits adb which can be utilizedfor quantization of sub-band signals, the number of bits bspl ofsub-band signal, the number of quantization bits b i! of each subbandsignal, flag indicating whether or not the number of bits is allocatedto each sub-band signal (hereinafter referred to as discrimination flag)used i!, and energy σ² i! of each sub-band signal are respectivelyinitialized.

In more practical sense, the number of bits adb which can be utilizedfor quantization of subband signal is set a value represented byadb=cb-(bbal+bscf), i.e., a value obtained by subtracting the number ofbits bbal necessary for bit allocation and the number of bits bscf ofscale factor from the number of all utilizable bits cb.

Moreover, setting is made such that bspl=0, b i!=0 and used i!=0, i.e.,the number of bits bspl of subband signal, the number of quantizationbits b i! of each subband signal, and discrimination flag used i! arerespectively equal to "0".

Further, setting is made such that σ i!=SF i!, i.e., with "σ i!" beingas scale factor SF i!, energy σ² i! of each subband signal is given bysquare of scale factor SF i! of each sub-band signal.

In the case where used i!=0,i.e., the discrimination flag used i! is"0", it is indicated that the number of bits is not yet allocated to thecorresponding subband. Moreover, in the case where used i!=1, i.e., thediscrimination flag used i! is "1", it is indicated that the number ofbits has been already allocated to the corresponding subband. Inaddition, in the case where used i!=2, i.e. , the discrimination flagused i! is "2", it is indicated that the number of bits cannot beallocated any more to the corresponding subband.

Moreover, the number of bits allocated to each subband is assumed to be0˜15 bits except for 1 bit.

At the subsequent step SP302, whether or not the number of bits can beallocated any more to each subband signal is judged. Namely, whether ornot the discrimination flag used i! (0≦i≦31) is "2" is judged. In thecase where used ∀i!=2, i.e., bits cannot be allocated to all subbandsignals, the bit allocation processing in the bit allocation section 103is completed.

Moreover, at step SP303, in the case where ∃i, such that used i!≠2,i.e., any subband signal to which the number of bits is allocatedexists, a subband signal having the maximum "σ i!" is taken out from thesubband signal to which that number of bits can be allocated. At thistime, in the case where a plurality of subbands having the maximum "σi!" exist, since sensitivity in the lower frequency band is higher thanthat in the higher frequency band from a viewpoint of the auditorysense, the subband signal of the lowest frequency band is taken out.Namely, the index max of the subband signal having the maximum "σ i!" isexpressed as follows:

    max=Min{i|used i!≠2, σ i!≧σ ∀j!}

At step SP 304, for the purpose of quantization of the signal of 12samples of the subband signal having the maximum "σ i!", the number ofbits smpl bit to be added is calculated. In the case where any number ofbits is not allocated to the subband signal until now, 2 bits per onesignal, 24 bits in total are added. In addition, in the case where thenumber of bits has been already allocated to the subband signal, 1 bitper one signal, 12 bits in total are added. Namely, the number of bitsto be added smpl bit can be determined by the following operationexpressed below:

    smpl bit=24-used  max!×12

At the subsequent step SP 305, whether or not the number of bits to beadded smpl bit which has been determined in a manner as described abovecan be really added is judged. If adb≧bspl+smpl bit, i.e., the valueobtained by adding the number of bits smpl bit which is to be added tothe number of bits bspl which has been allocated is less than the numberof bits adb which can be utilized for quantization of the subbandsignal, since the number of bits to be added smpl bit which has beencalculated at the above-described step SP304 can be added to theabove-mentioned subband signal, the processing operation shifts to thesubsequent step SP 306. In contrast, if adb<bspl+smpl bit, since thenumber of bits cannot be allocated any more to the corresponding subbandsignal, the processing operation shifts to step SP311 to make a settingof used max!=2, i.e., to set the discrimination flag used max! to "2"thereafter to return to judgment of bit allocation of theabove-described step SP302.

Thus, at step SP306, bspl+=smpl bit, i.e., the number of bits to beadded smpl bit is added to the number of bits bspl which has beenallocated for quantization of the subband signal.

At the subsequent step SP307, setting is made such that b max!+=2-usedmax!, i.e., in the case where allocation bits are not set until now asthe number of quantization bits b max! of the subband signal (usedmax!=0), two bits are added. In contrast, in the case where allocationbits have been already set until now (used max!=1), 1 bit is added.

Further, at step SP308, setting is made such that σ max!/=4-used max!×2to reduce "σ max!" of the subband signal. In more practical sense, atthe above-described step SP307, in the case where the number ofallocation bits is increased by 2 bits, i.e., in the case where thediscrimination flag is "0" (used max!=0), "σ max!" is divided by "4". Inaddition, in the case where the number of allocation bits is increasedby 1 bit, i.e. in the case where the discrimination flag is "1" (usedmax!=1), "σ max!" is divided by 2.

While, in the initialization processing of the step SP301 of theflowchart shown in the FIG. 5 mentioned above, setting is made such thatσ i!=SF i!, such initialization processing may be conducted as follows.

Namely, quantized value SFid i! of the dynamic range dr of the subbandis used to make a setting described below as indicated by the step SP401of FIG. 6:

    σ i!=SFid i!

Since the relationship between the scale factor SF i! and the quantizedvalue SFid i! is expressed below from facts as described above,

    SF i!=r.sup.SFid i!/s+k

the processing for dividing the scale factor SF i! by constant r² isexpressed as follows by using the above-described relationship: ##EQU1##Namely, this processing can be replaced by the processing to subtractconstant ns from the quantized value SFid i!.

Thus, in the processing for reducing "σ max!" of the above-describedstep SP 308, the processing for dividing "σ max!" by "4", i.e., dividingthe scale factor SF max! by "4" is such that when r^(n) is assumed to beexpressed as follows:

    r.sup.n =4=2.sup.2

n is equal to "2" (n=2). Since the constant s is "3" (s=3) as describedabove, ns is thus expressed as follows:

    ns=2×3=6

Thus, this processing can be replaced by the processing for subtracting"6" from the scale factor SF max!.

In addition, the processing for dividing "σ max!" by "2" can besimilarly replaced by the processing for subtracting "3".

Accordingly, the processing of the step SP308 shown in the FIG. 5mentioned above, which is expressed below,

    σ max!/=4-used max!×2

can be replaced as described below, as indicated by the step SP408 ofthe FIG. 6 mentioned above

    σ max!-=6-used max!×3

At the subsequent step SP309, since at least two bits are allocated tothe subband signal as described above, setting is made such that usedmax!=1, i.e., the discrimination flag used max! is set to "1".

Further, at step SP310, judgment expressed as b max!=15 ?, i.e.,judgment as to whether or not the number of quantization bits b max!allocated to the subband signal is 15 bits is made.

In the case where b max!=15, i.e. the above-mentioned number ofquantization bits b max! was 15 bits at the step SP310, since the numberof bits cannot be allocated any more, the processing operation shifts tostep SP311 to make a setting of used max!=2, i.e., to set thediscrimination flag used max! to "2" thereafter to return to thejudgment of bit allocation of the above-described step SP302.

In the case where the above-mentioned number of quantization bits b max!is 14 bits or less, judgment is made such that the number of bits can bestill more allocated to the corresponding subband. Thus, the processingoperation returns to the judgment of bit allocation of theabove-described step SP302 as it is.

At times subsequent thereto, the processing of the step SP302 and thesteps subsequent thereto will be repeated until the discrimination flagused i! becomes equal to "2" with respect to all subband signals.

In a manner as described above, the bit allocation section 103 allocatesthe numbers of bits to all subband signals by using only scale factorsSF i! (=σ i!) of respective subband signals.

In more practical sense, assuming that scale factors SF of respectivesubbands subband 0˜subband 31 in the frames of times t₀ ˜t₁ of the inputsignal shown in the FIG. 2 mentioned above are determined as indicatedby the Table 3, for example, by the acaling section 102, in the case of,e.g., adb=140, result as shown in the Table 4 is obtained by theabove-described bit allocation processing at the bit allocation section103. Namely, 6 bits are allocated to the subband 0, 3 bits are allocatedto the subband 1, and 2 bits are allocated to the subband 2. In thiscase, the numbers of allocation bits of other respective subband3˜subband 31 become equal to zero.

    ______________________________________                                        subband       index  SF(scale factor)                                         ______________________________________                                        Table 3A                                                                       0            53     6501.995                                                  1            44     812.749                                                   2            43     645.080                                                   3            31     40.317                                                    4            35     101.594                                                   5            27     16.000                                                    6            27     16.000                                                    7            26     12.699                                                    8            27     16.000                                                    9            24     8.000                                                    10            31     40.317                                                   11            35     101.594                                                  12            27     16.000                                                   13            19     2.520                                                    14            18     2.000                                                    15            17     1.587                                                    Table 3B                                                                      16            16     1.260                                                    17            21     4.000                                                    18            15     1.000                                                    19            14     0.794                                                    20            17     1.578                                                    21            18     2.000                                                    22            14     0.794                                                    23            13     0.630                                                    24            14     0.794                                                    25            16     1.260                                                    26            14     0.794                                                    27            14     0.794                                                    28            16     1.260                                                    2g            16     1.260                                                    30            18     2.000                                                    31            20     3.175                                                    ______________________________________                                    

    ______________________________________                                        subband index       SF(scale factor)                                                                         allocation                                     ______________________________________                                        Table 4A                                                                       0      54          6501.995   6                                               1      44          812.749    3                                               2      43          645.080    2                                               3      31          40.317     0                                               4      35          101.594    0                                               5      27          16.000     0                                               6      27          16.000     0                                               7      26          12.699     0                                               8      27          16.000     0                                               9      24          8.000      0                                              10      31          40.317     0                                              11      35          101.594    0                                              12      27          16.000     0                                              13      19          2.520      0                                              14      18          2.000      0                                              15      17          1.587      0                                              Table 4B                                                                      16      16          1.260      0                                              17      21          4.000      0                                              18      15          1.000      0                                              19      14          0.794      0                                              20      17          1.578      0                                              21      18          2.000      0                                              22      14          0.794      0                                              23      13          0.630      0                                              24      14          0.794      0                                              25      16          1.260      0                                              26      14          0.794      0                                              27      14          0.794      0                                              28      16          1.260      0                                              29      16          1.260      0                                              30      18          2.000      0                                              31      20          3.175      0                                              ______________________________________                                    

In this example, the bit allocation section 103 is operative so thatwhen only scale factors SF are used to allocate the numbers of bits, inthe case where it carries out a processing for dividing the scale factorSF by constant, it conducts divisional operation of real number. In thiscase, the relationship expressed below is used

    SF=2.sup.SFid/s+k

to carry out bit allocation in a manner to replace the divisionaloperation of real number by subtractive operation of integer. Thus, thecircuit for bit allocation can become more simplified, and high speedoperation can be realized.

It is to be noted that, in the allocation processing for the numbers ofbits shown in the FIG. 6 mentioned above, the same step numbers arerespectively attached to the same processing as the allocationprocessing for the numbers of bits shown in the FIG. 5 mentioned above,and their explanation will be omitted.

The quantizing section 104 quantizes respective subband signals inaccordance with the above-mentioned formula (1) by the numbers of bitsallocated by the bit allocation section 103.

Further, the formatting section 105 composes the quantized subbandsignals, the scale factors and bit allocation information into a bitstream in accordance with a predetermined format to record it ontostorage media 106.

The operation of the encoder 1 constructed in a manner as describedabove will now be described.

The analysis filter bank 101 divides audio data inputted through inputterminal 100 into subband signals of 32 subbands to deliver the subbandsignals which have undergone band division to the scaling section 102.

The scaling section 102 calculates scale factors SF with respect torespective subband signals from the analysis filter bank 101 by theoperation expressed below by using quantized value SFid of the dynamicrange of the subband signal, constant r (=2), constant k (=-5) andinteger constant s (=3)

    SF=2.sup.kSPid/3-5

to deliver the calculated scale factor SF to the bit allocation section103.

The bit allocation section 103 allocates the number of bits to allsubbands by using only the scale factors SF in accordance with the scalefactors SF of respective subbands from the scaling section 102. Then,the bit allocation section 103 delivers the determined number ofallocation bits and the scale factors SF to the quantizing section 104.

The quantizing section 104 quantizes the subband signals correspondingto the allocated numbers of bits and the scale factors SF from the bitallocation section 103 by the allocated number of bits from the bitallocation section 103 to deliver the subband signals and the scalefactors SF which have been quantized to the formatting section 105.

The formatting section 105 composes the quantized subband signals, bitallocation information and the quantized scale factors from thequantizing section 104 into a bit stream in accordance with apredetermined format to record it onto storage media 106.

In a manner as described above, at the encoder 1, quantization ofrespective subband signals is carried out by the number of allocationbits determined by using only scale factors.

Since the encoding apparatus for audio data of this embodiment carriesout bit allocation with respect to respective subbands by using onlyscale factors SF in a manner as stated above, it is possible to carryout, also in decoding data encoded by the encoding apparatus for audiodata, operation of bit allocation similarly to the processing which hasbeen carried out in the above-described encoding. For this reason, inthe above-described encoding apparatus for audio data, it becomesunnecessary to output the numbers of allocation bits, and it isunnecessary to set upper limits of each number of allocation bits. Thus,it is possible to allocate bits to quantization of subband signals tosuch an extent free from requirements as described above. Accordingly,it is possible to allocate sufficient number of bits also to signals ofa specific frequency. Thus, improvement in the quantization efficiencycan be made.

Moreover, an approach is employed to give scale factor SF by thefollowing formula

    SF=r.sup.SFid/s+k

,thereby making it possible to replace the processing which dividesscale factor SF by constant r^(n) by the processing which subtractsconstant s×n from quantized value SFid. For this reason, in the circuitfor bit allocation, it is possible to replace a dividing circuit of realnumber by a subtracting circuit of integer. Accordingly, the circuit forbit allocation can be simplified and high speed operation can berealized.

It is to be noted that while respective band signals subject toquantization are caused to be subband signals divided into subbands of aplurality of frequency bands in the encoding apparatus for audio dataaccording to the above-described embodiment, those signals may bespectrum signals divided into spectrum groups of a plurality offrequency bands.

The configuration and the operation of the decoder 2 will now bedescribed.

The decoder 2 is composed of a bit stream development section 107 fordecomposing the bit stream recorded onto the storage media 106 by theencoder 1 into quantized subband signals, the bit allocation informationand (quantized) scale factors, an inverse quantizing section 108 forinverse-quantizing the quantized subband signals decomposed by the bitstream development section 107 so that the scale factors can bepreserved, and a synthesis filter bank 109 for synthesizing the subbandsignals inversely quantized by the inverse quantizing section 108 intoan audio signal to output it through an output terminal 110.

The inverse-quantizing section 108 is supplied with quantized value Y j!(0≦j<12) of subband signal from the bit stream development section 107,the number of quantization bits, and scale factor SF id!. In thisexample, the above-mentioned "id" indicates index of scale factor, andthe "SF id!" indicates scale factor having index of "id".

The inverse-quantizing processing in the inverse-quantizing section 108will be described below, in more practical sense, with reference to theflowchart shown in FIG. 7.

Initially, at step SP501, in accordance with the above-mentioned formula(2), conventional inverse-quantizing processing is implemented toquantized value Y i!. Namely, inverse-quantized value X j! (0≦j<12) ofquantized value Y j! of the subband signal is determined by theoperation expressed below:

    X j!=Y j!×SF id!×(2/(2.sup.N -1))

At the subsequent step SP502, whether or not the inverse-quantized valueX j! preserves scale factor SF id! is judged. In more practical sense,in the case where ∃j, such that |X j!|>SF id-1!, i.e., absolute value|X(j)| of the minimum one of inverse-quantized values X j! of 12 samplesis greater than the scale factor SF id-1! below by one stage (step), itis judged that the scale factor is preserved. Thus, inverse-quantizingprocessing at the inverse quantizing section 108 is completed.

Moreover, in the case where |X ∀i!|≦SF id-1!, i.e., with respect to allinverse-quantized values X j! of 12 samples, their absolute values (|Xj!|) are less than the scale factor SF (id-1), it is judged that noscale factors is preserved. In order to try (carry out) again inversequantization, the processing operation shifts to step SP503.

AT this step SP503, such a quantized value k (k>0) to bridge over thescale factor SF id-1! is initially determined.

In more practical sense,

    ((2k-1)/(2.sup.N -1))×SF id!<SF  id-1!, and

    SF  id-1!<((2k+1)/(2.sup.N -1))×SF id!

a quantized value k to satisfy the above inequality relationships isdetermined.

Then, the above-mentioned quantized value k is used to carry out retryprocessing of inverse quantization which will be explained below withrespect to all of quantized values of 12 samples Y j!(0≦j<12).

Initially, at step SP504, whether or not retry processing of inversequantization has been completed with respect to all quantized values Yj!(0≦j<12) of 12 samples is judged. As a result, in the case where j=12,i.e., retry processing of inverse quantization is completed, the inversequantizing processing at the inverse quantizing processing section 108is completed. In contrast, in the case where 0≦j<12, i.e., retryprocessing of inverse quantization is not completed, the processingoperation shifts to step SP505.

At this step SP505, whether or not the quantized value Y j! is quantizedinto the quantized value k is judged. Then, in the case where Y j!=k,i.e., the quantized value Y j! of the subband signal is quantized intothe quantized value k, the processing operation shifts to step SP506. Incontrast, in the case where Y j!≠k, i.e., the quantized value Y j! ofthe subband signal is not quantized into the quantized value k, theprocessing operation shifts to step SP507.

At the step SP506,

    X j!={SF id-1!+((2k+1)/2.sup.N -1))×SF id!/2

inverse-quantized value X j! is determined by the operation expressedabove. Then, the processing operation shifts to step SP509 to incrementthe index j to quantized value Y j! of the next sample thereafter toreturn to the judgment as to whether or not retry processing of inversequantization of the above-described step SP504 is completed.

Moreover, at the step SP507, whether or not quantized value Y j! of thesubband signal is quantized into a negative quantized value (-k) isjudged.

In the case where Y j!≠-k, i.e., the quantized value Y j! of the subbandsignal is not quantized into the negative quantized value (-k) , theprocessing operation shifts to the step SP509 to increment the index jto the quantized value Y j! of the next sample thereafter to return tothe judgment as to whether or not retry processing of inversequantization of the above-described step SP504 is completed. Incontrast, in the case where Y j!=-k, i.e. the quantized value Y j! ofthe subband signal is quantized into the negative quantized value (-k),the processing operation shifts to step SP508,

At the step SP508,

    X j!=-{SF id-1!+((2k+1)/(2.sup.n -1))×SF id!/2

inverse-quantized value X j! is determined by the operation expressedabove. The processing operation shifts to step SP509 to increment indexj to quantized value Y j! of the next sample thereafter to return to thejudgment as to whether or not retry processing of inverse quantizationof the above-described step SP504 is completed

As described above, the above-mentioned inverse quantizing section 108is operative so that in the case where absolute values of inversequantized values X j! of 12 samples are all less than the scale factorSF id-1! below by one stage (one step), it judges that scale factors SFid! are not preserved to carry out retry processing of inversequantization to determine, for a second time, inverse quantized values Xj! of 12 samples. Thus, the same scale factors SF id! as those beforequantization can be obtained.

The synthesis filter bank 109 includes a band synthesis section althoughnot shown, and serves to synthesize subband signals which have beencaused to undergo inverse quantization into an audio signal by the bandsynthesis section.

The operation of the decoder 2 constructed in a manner as describedabove will now be described.

The bit stream development section 107 decomposes bit stream recorded onthe storage media 106 of the above-described encoder 1 into quantizedsubband signals, bit allocation information and (quantized) scalefactors to deliver the quantized subband signals, the bit allocationinformation and the scale factors which have been decomposed to theinverse quantizing section 108.

The inverse quantizing section 108 inverse-quantizes the quantizedsubband signals from the bit stream development section 107 so that thescale factors from the bit stream development section 107 are preserved.Then, the inverse-quantizing section 108 delivers the inverse-quantizedsubband signals to the synthesis filter bank 109.

The synthesis filter bank 109 synthesizes the inverse-quantized subbandsignals from the inverse quantizing section 108 into an audio signal tooutput the audio signal thus obtained through output terminal 110.

As described above, at the encoder 1, subband signals are quantized bythe numbers of allocation bits determined by using only scale factors ofrespective subbands. At the decoder 2, since the subband signalsquantized by the encoder 1 are inverse-quantized so that scale factorsof respective subbands are preserved, in the case where encoding anddecoding are repeated, the same numbers of allocation bits aredetermined every time. Accordingly, since the same results can beobtained every time in the quantization and the inverse-quantization, itis possible to carry out dubbing, etc. of audio data without allowingsound quality to be deteriorated even if encoding and decodingoperations are repeated.

It is to be noted that, in decomposing, for a second time, audio signalsdecoded by the decoder 2 into subband signals by the encoder 1 tocalculate scale factors, encoding block constituted with 12 subbandsignals is caused to be the same encoding block as that of the lasttime.

To speak in more practical sense, e.g., at the inverse quantizingsection 108, management of the time required for inverse-quantization(hereinafter referred to as inverse-quantization processing time) iscarried out. Then, in carrying out decomposition into 12 subband signalsat the analysis filter bank 101, decomposition is carried out in amanner shifted by the inverse quantization processing time, wherebyextraction starting times of the encoding block are the same every timeAccordingly, the same scale factors can be obtained every time, and thesame results can be obtained every time also with respect to the numbersof allocation bits. Thus, it is possible to carry out of copying, etc,of audio data without allowing the sound quality to be deteriorated evenif encoding and decoding operations are repeated.

Namely, sample of, e.g., X=-5214 of subband signals of subband 0 in theframe of the time t₀ ˜t₁ of the input signal shown in the FIG. 2mentioned above, for example, is quantized into quantized value Y=25 inaccordance with the above described formula (1) as follows: ##EQU2## Ifthis is inverse-quantized by the above-described formula (2) inaccordance with the conventional technique, the following result isobtained. ##EQU3## Its inverse-quantized value X=5160.3 would be a valuesmaller than the scale factor SF-5160.6 below by one level of theoriginal scale factor SF-6502. Namely since if the inverse quantizedvalue X=5160.3 obtained in this way is quantized for a second time,since the scale factor SF is changed, bit allocation change. Thus, thesound quality would also change.

However, in the encoding/decoding apparatus of this embodiment, in thecase where absolute values of inverse quantized values X j! of 12samples are less than scale factor SF id-1! below by one stage (level),it is judged at the inverse quantizing section 108 that scale factors SFid! are not preserved to retry inverse quantization to obtaininverse-quantized value X j! having the same scale factor SF id! as thatbefore quantization. Accordingly, it is possible to preserve scalefactors SF id!.

What is claimed is:
 1. An encoding method, comprising the stepsof:dividing an input signal into a plurality of signals, each of thesignals being in a preselected frequency band; calculating acorresponding scale factor for each of the signals; allocating a numberof bits to each of the signals as a function of said corresponding scalefactor by ascertaining for said each signal whether no bits have beenallocated to a respective signal such that 2 bits are allocated to saidrespective signal, by ascertaining whether some bits have been allocatedto said respective signal such that an additional 1 bit is allocatedthereto, and by ascertaining whether a predetermined number of bits hasbeen fully allocated to said respective signal such that no additionalbits are allocated thereto; quantizing each of the signals with thecorresponding allocated bits; and encoding each of the quantized signalsand each of the scale factors.
 2. The method according to claim 1,wherein each of the signals is a subband signal.
 3. The method accordingto claim 1, wherein each of the signals is a spectrum signal.
 4. Themethod according to claim 1, wherein said calculating step is defined bySF=r^(SFid/s+k), wherein SFid is a quantized dynamic range of one of thesignals, SF is said corresponding scale factor, and r, s and k arepredetermined constants.
 5. The method according to claim 1, wherein avariable number of bits are allocated to each of the signals.
 6. Adecoding method for decoding an encoded signal by dividing an inputsignal into a plurality of signals, each of the signals being in apreselected frequency band, by calculating a corresponding scale factorfor each of the signals, by allocating a number of bits to each of thesignals as a function of said corresponding scale factor by ascertainingfor said each signal whether no bits have been allocated to a respectivesignal such that 2 bits are allocated to said respective signal, byascertaining whether some bits have been allocated to said respectivesignal such that an additional 1 bit is allocated thereto, and byascertaining whether a predetermined number of bits has been fullyallocated to said respective signal such that no additional bits areallocated therto, by quantizing each of the signals with thecorresponding allocated bits, and by encoding each of the quantizedsignals and each of the scale factors, said decoding method comprisingthe steps of:determining how many bits had been allocated to each of thesignals as a function of the encoded corresponding scale factor;inverse-quantizing each of the signals with the corresponding allocatedbits; determining whether each of the scale factors is preserved; andinverse-quantizing each of the signals if none of the scale factors ispreserved, wherein said encoded signal is so decoded that each of thescale factors is preserved.
 7. The method according to claim 6, whereineach of the signals is a subband signal.
 8. The method according toclaim 6, wherein each of the signals is a spectrum signal.
 9. Anencoding/decoding method, comprising the steps of:dividing an inputsignal into a plurality of signals, each of the signals being in apreselected frequency band; calculating a corresponding scale factor foreach of the signals; allocating a number of bits to each of the signalsas a function of said corresponding scale factor by ascertaining forsaid each signal whether no bits have been allocated to a respectivesignal such that 2 bits are allocated to said respective signal, byascertaining whether some bits have been allocated to said respectivesignal such that an additional 1 bit is allocated thereto, and byascertaining whether a predetermined number of bits has been fullyallocated to said respective signal such that no additional bits areallocated thereto; quantizing each of the signals with the correspondingallocated bits; encoding each of the quantized signals and each of thescale factors; determining how many bits had been allocated to each ofthe signals as a function of the encoded corresponding scale factor;inverse-quantizing each of the signals with the corresponding allocatedbits; determining whether each of the scale factors is preserved; andinverse-quantizing each of the signals if none of the scale factors ispreserved, wherein said encoded signal is so decoded that each of thescale factors is preserved.
 10. The method according to claim 9, whereineach of the signals is a subband signal.
 11. The method according toclaim 9, wherein each of the signals is a spectrum signal.
 12. Themethod according to claim 9, wherein said calculating step is defined bySF=r^(SFid/s+k), wherein SFid is a quantized dynamic range of one of thesignals, SF is said corresponding scale factor, and r, s and k arepredetermined constants.
 13. The method according to claim 9, wherein avariable number of bits are allocated to each of the signals. 14.Encoding apparatus, comprising:band dividing means for dividing an inputsignal into a plurality of signals, each of the signals being in apreselected frequency band; scaling means for calculating acorresponding scale factor for each of the signals; bit allocation meansfor allocating a number of bits to each of the signals as a function ofsaid corresponding scale factor by ascertaining for said each signalwhether no bits have been allocated to a respective signal such thatsaid bit allocation means is operative to allocate 2 bits to saidrespective signal, by ascertaining whether some bits have been allocatedto said respective signal such that said bit allocation means isoperative to allocate an additional 1 bit thereto, and by ascertainingwhether a predetermined number of bits has been fully allocated to saidrespective signal such that said bit allocation means is operative toallocate no additional bits thereto; quantizing means for quantizingeach of the signals with the corresponding allocated bits; andformatting means for encoding each of the quantized signals and each ofthe scale factors, and for outputting thereof.
 15. Apparatus accordingto claim 14, wherein each of the signals is a subband signal. 16.Apparatus according to claim 14, wherein each of the signals is aspectrum signal.
 17. Apparatus according to claim 14, wherein saidcorresponding scale factor is defined by r^(SFid/s+k), wherein SFid is aquantized dynamic range of one of the signals, and r, s and k arepredetermined constants.
 18. Apparatus according to claim 14, wherein avariable number of bits are allocated to each of the signals. 19.Decoding apparatus for decoding an encoded signal, including banddividing means by dividing an input signal into a plurality of signals,each of the signals being in a preselected frequency band, scaling meansfor calculating a corresponding scale factor for each of the signals,bit allocation means for allocating a number of bits to each of thesignals as a function of said corresponding scale factor by ascertainingfor said each signal whether no bits have been allocated to a respectivesignal such that said bit allocation means is operative to allocate 2bits to said respective signal, by ascertaining whether some bits havebeen allocated to said respective signal such that said bit allocationmeans is operative to allocate an additional 1 bit thereto, and byascertaining whether a predetermined number of bits has been fullyallocated to said respective signal such that said bit allocation meansis operative to allocate no additional bits thereto, quantizing meansfor quantizing each of the signals with the corresponding allocatedbits, and formatting means for encoding each of the quantized signalsand each of the scale factors, and for outputting thereof, said decodingapparatus comprising:means for determining how many bits had beenallocated to each of the signals as a function of the encodedcorresponding scale factor; means for inverse-quantizing each of thesignals with the corresponding allocated bits; means for determiningwhether each of the scale factors is preserved; and means forinverse-quantizing each of the signals if none of the scale factors ispreserved, wherein said encoded signal is so decoded that each of thescale factors is preserved.
 20. Encoding/decoding apparatus,comprising:band dividing means for dividing an input signal into aplurality of signals, each of the signals being in a preselectedfrequency band; scaling means for calculating a corresponding scalefactor for each of the signals; bit allocation means for allocating anumber of bits to each of the signals as a function of saidcorresponding scale factor by ascertaining for said each signal whetherno bits have been allocated to a respective signal such that said bitallocation means is operative to allocate 2 bits to said respectivesignal, by ascertaining whether some bits have been allocated to saidrespective signal such that said bit allocation means is operative toallocate an additional 1 bit thereto, and by ascertaining whether apredetermined number of bits has been fully allocated to said respectivesignal such that said bit allocation means is operative to allocate noadditional bits thereto; quantizing means for quantizing each of thesignals with the corresponding allocated bits; formatting means forencoding each of the quantized signals and each of the scale factors,and for outputting thereof; means for determining how many bits had beenallocated to each of the signals as a function of the encodedcorresponding scale factor; means for inverse-quantizing each of thesignals with the corresponding allocated bits; means for determiningwhether each of the scale factors is preserved; and means forinverse-quantizing each of the signals if none of the scale factors ispreserved, wherein said encoded signal is so decoded that each of thescale factors is preserved.
 21. Apparatus according to claim 20, whereineach of the signals is a subband signal.
 22. Apparatus according toclaim 20, wherein each of the signals is a spectrum signal. 23.Apparatus according to claim 20, wherein said corresponding scale factoris defined by r^(SFid/s+k), wherein SFid is a quantized dynamic range ofone of the signals, and r, s and k are predetermined constants. 24.Apparatus according to claim 20, wherein a variable number of bits areallocated to each of the signals.